home *** CD-ROM | disk | FTP | other *** search
- '****************************************************************
- '* Ingredient group file type *
- '****************************************************************
- Type IngGroupType
- IngGroup As String * 4
- IngGroupDesc As String * 30
- End Type
-
- Global IngGroupRec As IngGroupType
- Global IngGroupSaveRec As IngGroupType
- Global IngGroupSt%
- Global IngGroupKeyB$
- Global IngGroupPosBlk As PosBlk
-
- Sub CloseIngGroupFile ()
- '********** Close Ingredient group file **********************
- IngGroupKeyBufLen% = 255
- IngGroupBufLen% = Len(IngGroupRec)
- KeyNum% = 0
- IngGroupSt% = 0
- IngGroupSt% = btrcall(BCLOSE, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
- End Sub
-
- Sub DeleteIngGroup ()
- IngGroupKeyBufLen% = 255
- IngGroupBufLen% = Len(IngGroupRec)
- KeyNum% = 0
- IngGroupSt% = 0
- IngGroupSt% = btrcall(BDELETE, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
- End Sub
-
- Sub FirstIngGroup ()
- If Len(IngGroupKeyB$) <> 4 Then
- IngGroupKeyB$ = String$(4, " ")
- End If
- IngGroupKeyBufLen% = 255
- IngGroupBufLen% = Len(IngGroupRec)
- KeyNum% = 0
- IngGroupSt% = 0
- IngGroupSt% = btrcall(BFIRST, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
- End Sub
-
- Sub MsgIngGroupNotFound ()
- Msg$ = "Ingredient group not found. Status = " + Str$(IngGroupSt%)
- T1% = MsgBox(Msg$, 0, "Warning!")
- End Sub
-
- Sub MsgIngGroupNotOpen ()
- Msg$ = "Ingredient group file not opened."
- T1% = MsgBox(Msg$, 0, "Warning!")
- End Sub
-
- Sub MsgUnknownIngGroupError ()
- Msg$ = "Ingredient group file error. Status = " + Str$(IngGroupSt%)
- T1% = MsgBox(Msg$, 0, "Warning!")
- End Sub
-
- Sub NextIngGroup ()
- If Len(IngGroupKeyB$) <> 4 Then
- IngGroupKeyB$ = String$(4, " ")
- End If
- IngGroupKeyBufLen% = 255
- IngGroupBufLen% = Len(IngGroupRec)
- KeyNum% = 0
- IngGroupSt% = 0
- IngGroupSt% = btrcall(BNEXT, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
- End Sub
-
- '
- '
- Sub OpenIngGroupFile ()
-
- '******** Open Ingredient group File ********************
- IngGroupKeyB$ = "ingrfile.btr"
- IngGroupKeyBufLen% = 255
- IngGroupBufLen% = Len(IngGroupRec)
- KeyNum% = 0
- IngGroupSt% = 0
- IngGroupSt% = btrcall(BOPEN, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
- If IngGroupSt% <> 0 Then
- Msg$ = "Ingredient group file open failed. Status = " + Str$(IngGroupSt%)
- T1% = MsgBox(Msg$, 0, "Warning!")
- End If
- End Sub
-
- Sub PreviousIngGroup ()
- If Len(IngGroupKeyB$) <> 4 Then
- IngGroupKeyB$ = String$(4, " ")
- End If
- IngGroupKeyBufLen% = 255
- IngGroupBufLen% = Len(IngGroupRec)
- KeyNum% = 0
- IngGroupSt% = 0
- IngGroupSt% = btrcall(BPREVIOUS, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
- End Sub
-
- Sub ReadIngGroup ()
- IngGroupKeyB$ = IngGroupRec.IngGroup
- IngGroupKeyBufLen% = 255
- IngGroupBufLen% = Len(IngGroupRec)
- KeyNum% = 0
- IngGroupSt% = 0
- IngGroupSt% = btrcall(BEQUAL, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
- End Sub
-
- Sub UpdateIngGroup ()
- IngGroupKeyBufLen% = 255
- IngGroupBufLen% = Len(IngGroupRec)
- KeyNum% = 0
- IngGroupSt% = 0
- IngGroupSt% = btrcall(BUPDATE, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
- End Sub
-
- Sub WriteIngGroup ()
- IngGroupKeyBufLen% = 255
- IngGroupBufLen% = Len(IngGroupRec)
- KeyNum% = 0
- IngGroupSt% = 0
- IngGroupSt% = btrcall(BINSERT, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
- End Sub
-
-